# Maintainer: Maxime Gauduin <alucryd@archlinux.org>

pkgname=light-locker
pkgver=1.9.0
pkgrel=5
pkgdesc='A simple session locker for LightDM'
arch=(loong64 x86_64)
url=https://github.com/the-cavalry/light-locker
license=(GPL2)
depends=(
  cairo
  dbus-glib
  glibc
  libdbus-1.so
  libgdk-3.so
  libgio-2.0.so
  libglib-2.0.so
  libgobject-2.0.so
  libgtk-3.so
  libpango-1.0.so
  libpangocairo-1.0.so
  libsystemd.so
  libx11
  libxext
  libxss
)
makedepends=(
  git
  gnome-common
  intltool
  meson
  upower
  xorgproto
)
optdepends=('upower: Power management support')
_tag=7a96e9f87dc95c794cd45fd0378a62f45308ea87
source=(git+https://github.com/the-cavalry/light-locker.git#tag=${_tag})
sha256sums=(SKIP)

pkgver() {
  cd light-locker

  git describe --tags | sed 's/^v//'
}

prepare() {
  cd light-locker

  git cherry-pick -n d3ea262b336cf66ec41d25a8ea021d759c2c3a1d
  git cherry-pick -n 366fdbfe284efacf39d887a0512d38030af7ff16
  git cherry-pick -n 6224184e2677d76c7904d488b0e9295886fa9ee3
  git cherry-pick -n 8e03981e83fd03920e8e68145d0eb933dddb4c3c
}

build () {
  arch-meson light-locker build
  ninja -C build
}

package() {
  DESTDIR="${pkgdir}" ninja -C build install
}

# vim: ts=2 sw=2 et:
